import dao.AdminMapper;
import org.apache.ibatis.session.SqlSession;
import org.junit.Test;
import pojo.Admin;
import util.SqlSessionFactoryUtil;

public class Demo {

    @Test
    public void test1(){
        SqlSession session = SqlSessionFactoryUtil.getSqlSession();
        try {
            AdminMapper adminMapper = session.getMapper(AdminMapper.class);
            Admin admin =new Admin("lisiyu","123");
            adminMapper.addAdmin(admin);
            session.commit();
        }catch (Exception e ){
            e.printStackTrace();
        }finally {
            session.close();
        }
    }
}
